package com.shsxt.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.shsxt.dao.UserMapper;
import com.shsxt.po.User;
import com.shsxt.service.UserService;

@Service
public class UserServiceImpl implements UserService {
	@Resource
	private UserMapper userMapper;

	@Override
	public User queryUserById(int id) {
		return userMapper.queryUserById(id);
	}

	@Override
	public PageInfo<User> queryUsers(int pageNum, int pageSize) {

		// 启动分页
		PageHelper.startPage(pageNum, pageSize);
		List<User> list = userMapper.queryUsers();
		PageInfo<User> pageInfo = new PageInfo<User>(list);
		return pageInfo;
	}

}
